package com.ruoyi.project.agreement.mapper;

import com.ruoyi.project.agreement.domain.AgreementInfo;
import com.ruoyi.project.agreement.domain.dto.AgreementDto;

import java.util.List;

public interface AgreementInfoMapper {

    /**
     * 查询合同信息
     * @param agreementInfo
     * @return
     */
    List<AgreementInfo> selectAgreementList(AgreementInfo agreementInfo);

    /**
     * 查询客户关联的合同
     * @param customId
     * @return
     */
    List<AgreementInfo> selectAgreementByCustomId(String customId);

    /**
     * 查询有效的合同列表
     * @return
     */
    List<AgreementInfo> selectValidAgreementList(AgreementInfo agreementInfo);

    /**
     * 查询合同明细
     * @param id
     * @return
     */
    AgreementInfo selectAgreementById(String id);

    /**
     * 查询是否存在相同的合同编号
     * @param agreementInfo
     * @return
     */
    int checkAgreementByNumber(AgreementInfo agreementInfo);

    /**
     * 新增合同
     * @param agreementInfo
     * @return
     */
    int insertAgreement(AgreementInfo agreementInfo);

    /**
     * 修改合同
     * @param agreementInfo
     * @return
     */
    int updateAgreement(AgreementInfo agreementInfo);

    /**
     * 删除合同
     * @param id
     * @return
     */
    int deleteAgreement(String id);

    /**
     * 查询客户最后一次的签约合同
     * @param agreementInfo
     * @return
     */
    List<AgreementInfo> selectMaxEndDateAgreement(AgreementInfo agreementInfo);
}
